import { RouteRecordRaw } from 'vue-router'
export const constantRoute: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: '/home',
  },
  {
    path: '/login',
    name: 'login',
    meta: {
      title: '用户登录',
    },
    component: () => import('@/views/login/index.vue'),
  },
  {
    path: '/home',
    name: 'home',
    meta: {
      title: '首页',
    },
    component: () => import('@/views/home/index.vue'),
  },
  {
    path: '/add-transaction',
    name: 'add-transaction',
    meta: {
      title: '添加事务',
    },
    component: () => import('@/views/add-transaction/index.vue'),
  },
  {
    path: '/add-week-plan',
    name: 'add-week-plan',
    meta: {
      title: '周计划设置',
    },
    component: () => import('@/views/add-week-plan/index.vue'),
  },
  // {
  //   path: '/person-info',
  //   name: 'person-info',
  //   meta: {
  //     title: '个人信息',
  //   },
  //   component: () => import('@/views/myset/person-info/index.vue'),
  // },
  // {
  //   path: '/my-work',
  //   name: 'my-work',
  //   meta: {
  //     title: '我的事务',
  //   },
  //   component: () => import('@/views/myset/my-work/index.vue'),
  // },
  // {
  //   path: '/any-info',
  //   name: 'any-info',
  //   meta: {
  //     title: '其他',
  //   },
  //   component: () => import('@/views/myset/any-info/index.vue'),
  // },
  {
    path: '/today-work',
    name: 'today-work',
    meta: {
      title: '今日事务',
    },
    component: () => import('@/views/today-work/index.vue'),
  },
  {
    path: '/all-work',
    name: 'all-work',
    meta: {
      title: '全部事务',
    },
    component: () => import('@/views/all-work/index.vue'),
  },
  {
    path: '/add-plan',
    name: 'add-plan',
    meta: {
      title: '添加事务',
    },
    component: () => import('@/views/add-plan/index.vue'),
  },
  {
    path: '/setting',
    name: 'setting',
    meta: {
      title: '我的设置',
    },
    redirect: '/setting/profile',
    component: () => import('@/views/setting/index.vue'),
    children: [
      {
        path: 'profile',
        name: 'profile',
        meta: {
          title: '个人资料',
        },
        component: () => import('@/views/setting/profile/index.vue'),
      },
      {
        path: 'account',
        name: 'account',
        meta: {
          title: '账号设置',
        },
        component: () => import('@/views/setting/account/index.vue'),
      },
      {
        path: 'common',
        name: 'common',
        meta: {
          title: '通用设置',
        },
        component: () => import('@/views/setting/common/index.vue'),
      },
    ],
  },
  {
    path: '/404',
    name: '404',
    meta: {
      title: '404',
    },
    component: () => import('@/views/404/index.vue'),
  },
]

export const asyncRoute: RouteRecordRaw[] = []
export const anyRoute: RouteRecordRaw[] = [
  {
    //任意路由
    path: '/:pathMatch(.*)*',
    redirect: '/404',
    name: 'any',
    meta: {
      title: '任意路由',
    },
  },
]
